%% Alpha estimates
%
% Computes alpha using different approaches
%% Rights and disclaimer
%
% Author: Benjamin J. J. Voigt (bvoigt@gmail.com)
% Published: Oct 2012
% Version: 0.0.1
% License: BSD 2-Clause, free to use and copy retaining original author reference
% 
% Disclaimer: USE AT YOUR OWN RISK; NO INVESTMENT RECOMMENDATION IMPLIED;
% NOT ASSOCIATED WITH PAST, CURRENT OR FUTURE EMPLOYER OR ASSOCIATES OF THE
% AUTHOR; DO NOT USE THIS CODE TO INVEST YOUR OWN MONEY OR TO 
% ENCOURAGE OTHERS TO INVEST MONEY;
%% Syntax
%
% [alpha residual] = AlphaEstimates(symbol_cell, symbol_current_price)
%% Arguments
%
% symbol_cell - A single row cell array of strings containing Reuters symbols in
% each column.
%
% symbol_curren_price - A single row cell array of numbers containing 
% a current price in each column id coresponding to the symbol_cell position.
%% Examples
% Estimate the alpha for a two stock scenario
%
% alphaEst = AlphaEstimates({'HPQ' 'DELL'}, [17.32 13.30];
%
%% Required toolboxes
%
% Financial Toolbox, Data Feed Toolbox, Statistics
% Toolbox
%% Purpose and notes
%
% Purpose: Estimate alpha values
%
% Notes: --
%
% Known limitations:
% 1) Estimates for equity asset class only at this time
%

function [alpha residual] = AlphaEstimates(symbol_cell, symbol_current_price)

% Global, function wide variables 
g_symbol_cell = symbol_cell;
g_symbol_current_price = symbol_current_price;

% Local, dummy, loop or sub-section specific variables
l_symbol_target_price = zeros(length(g_symbol_cell),1);

% Estimate target price
l_symbol_target_price = EQTargetPriceEst(g_symbol_cell, 'sourced');

% Assign primary result variables
alpha = (l_symbol_target_price-g_symbol_current_price)./g_symbol_current_price;

